package czk.concrent.resultrunnable;

/**
 * @Author:ChenZhangKun
 * @Date: 2021/9/3 13:54
 */
public class TaskExecutor implements Runnable {
    private TaskCallable<TaskResult> taskCallable;
    private TaskResult taskResult;
    public TaskExecutor(TaskCallable<TaskResult> taskCallable,TaskResult taskResult) {
        this.taskCallable = taskCallable;
        this.taskResult=taskResult;
    }

    @Override
    public void run() {
        taskResult.setTaskMessage("执行run方法了");
        taskResult.setTaskResult("执行成功");
        // 执行方法
        taskCallable.callable(taskResult);
    }
}
